# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>

_pkg=MooX-late
pkgname=perl-${_pkg,,}
pkgver=0.100
pkgrel=4
pkgdesc="Easily translate Moose code to Moo"
arch=('any')
url="https://metacpan.org/release/${_pkg}"
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-moo' 'perl-type-tiny' 'perl-moox-handlesvia' 'perl-sub-handlesvia')
checkdepends=('perl-test-fatal' 'perl-test-simple' 'perl-test-requires')
source=("https://cpan.metacpan.org/authors/id/T/TO/TOBYINK/${_pkg}-${pkgver}.tar.gz")
sha512sums=('69450edbe7b2192094608a3ec543348d87223c9a124b86dc04a1cdf74b697adb331e5e1498533a557e5d4eded374770086d6696bdda597afe924520cad0c229c')

build() {
    cd ${_pkg}-${pkgver}
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd ${_pkg}-${pkgver}
    make test
}

package() {
    cd ${_pkg}-${pkgver}
    make INSTALLDIRS=vendor DESTDIR="$pkgdir" install
}
